/*
 * downloader.h
 *
 *  Created on: May 1, 2011
 *      Author: xrose
 */

#ifndef DOWNLOADER_H_
#define DOWNLOADER_H_
#include "httpConnections.h"
#include "urlFile.h"
#include "incdefault.h"
#include "thrdStruct.h"
#include "thrTable.h"

class downloader{
public:
	downloader();
	downloader(string, int);
	downloader(string, int, string);
	~downloader();
	//
	bool downloadThreadId(int);
	bool saveFile();
	static void * threadEntryPoint(void*);

private:
	int _threadnum;
	thrTable _thrTable;
	Url _url;
	urlFile _file;
	pthread_mutex_t fileLocker;
	string _filename;

};

#endif /* DOWNLOADER_H_ */
